@zonos/elements 1.3.173 → 1.3.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{CheckoutConfig-c5943bbf.js → CheckoutConfig-fb59baa3.js} +1 -1
- package/dist/cjs/{cart-d9052930.js → cart-93ed3002.js} +1 -1
- package/dist/cjs/{handleFetch-ff25db40.js → handleFetch-969d05d8.js} +36 -13
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{paypal-31477331.js → paypal-8b49ef07.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +3 -4
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +7 -8
- package/dist/cjs/zonos-checkout.cjs.entry.js +13 -11
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/utils/logging/getAdditionalLogMetadata.js +1 -1
- package/dist/collection/components/utils/logging/prepLoadTimeApiLog.js +30 -12
- package/dist/collection/components/utils/logging/sendBulkLoadTimeApiLog.js +6 -3
- package/dist/collection/types/generated/graphql.frontend.types.js +3 -9
- package/dist/collection/types/generated/graphql.internal.types.js +1 -6
- package/dist/esm/{CheckoutConfig-75af3742.js → CheckoutConfig-63b3ed06.js} +1 -1
- package/dist/esm/{cart-fff4f4a4.js → cart-54d84646.js} +1 -1
- package/dist/esm/{handleFetch-0109fb78.js → handleFetch-621e45bc.js} +36 -14
- package/dist/esm/index.js +10 -10
- package/dist/esm/{paypal-087fbd16.js → paypal-17a320c8.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +2 -3
- package/dist/esm/zonos-cart-items_13.entry.js +3 -4
- package/dist/esm/zonos-checkout.entry.js +10 -8
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-empty-state-payment_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/{CheckoutConfig-75af3742.js → CheckoutConfig-63b3ed06.js} +1 -1
- package/dist/esm-es5/{cart-fff4f4a4.js → cart-54d84646.js} +1 -1
- package/dist/esm-es5/handleFetch-621e45bc.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-087fbd16.js → paypal-17a320c8.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +20 -12
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/logging/getAdditionalLogMetadata.d.ts +4 -1
- package/dist/types/components/utils/logging/prepLoadTimeApiLog.d.ts +2 -4
- package/dist/types/types/LogLoadScript.d.ts +22 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +12 -93
- package/dist/types/types/generated/graphql.frontend.types.ts +22 -107
- package/dist/types/types/generated/graphql.internal.types.d.ts +1 -29
- package/dist/types/types/generated/graphql.internal.types.ts +1 -46
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-0db19b02.entry.js → p-0ee9b22a.entry.js} +1 -1
- package/dist/zonos-elements/p-0fc02cde.js +1 -0
- package/dist/zonos-elements/{p-514431e9.system.entry.js → p-19ac0f84.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1be7b435.system.entry.js → p-1b6d0895.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1b75aa35.system.js +1 -0
- package/dist/zonos-elements/p-28dcd7bb.entry.js +1 -0
- package/dist/zonos-elements/{p-ada6e691.system.entry.js → p-3d169241.system.entry.js} +1 -1
- package/dist/zonos-elements/p-416ac901.entry.js +1 -0
- package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
- package/dist/zonos-elements/{p-7862da71.entry.js → p-4a87a92c.entry.js} +1 -1
- package/dist/zonos-elements/{p-a9d7746a.entry.js → p-4c6dfe2e.entry.js} +1 -1
- package/dist/zonos-elements/p-6612e6f9.system.entry.js +1 -0
- package/dist/zonos-elements/{p-bfd6e156.js → p-75b771cf.js} +1 -1
- package/dist/zonos-elements/{p-73a7b89b.entry.js → p-78a95cee.entry.js} +1 -1
- package/dist/zonos-elements/{p-38f6f6fd.system.js → p-84dd312c.system.js} +1 -1
- package/dist/zonos-elements/{p-1c488ecf.js → p-869bbedc.js} +1 -1
- package/dist/zonos-elements/{p-78b81404.system.js → p-8964d8f8.system.js} +1 -1
- package/dist/zonos-elements/{p-5275b7ca.system.entry.js → p-8e436df2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-31ce9143.system.entry.js → p-9f8b820e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-759a654a.system.js → p-a1d54022.system.js} +1 -1
- package/dist/zonos-elements/p-b86b82eb.entry.js +1 -0
- package/dist/zonos-elements/p-c67f6666.system.entry.js +1 -0
- package/dist/zonos-elements/p-d22c15be.entry.js +1 -0
- package/dist/zonos-elements/p-d74ab632.system.entry.js +1 -0
- package/dist/zonos-elements/{p-67ca7373.entry.js → p-d9779ea7.entry.js} +1 -1
- package/dist/zonos-elements/{p-a83370c6.system.entry.js → p-d98fa14c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2ebb4fa7.system.js → p-e0d3aeae.system.js} +1 -1
- package/dist/zonos-elements/{p-0078362c.system.entry.js → p-e11eecbf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-407a96d2.entry.js → p-ed8a8a44.entry.js} +1 -1
- package/dist/zonos-elements/{p-cbd2bd33.js → p-f80f24a0.js} +2 -2
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/isCheckoutMobile-f491ca7c.js +0 -8
- package/dist/esm/isCheckoutMobile-8846dccb.js +0 -6
- package/dist/esm-es5/handleFetch-0109fb78.js +0 -1
- package/dist/esm-es5/isCheckoutMobile-8846dccb.js +0 -1
- package/dist/zonos-elements/p-033817e3.system.entry.js +0 -1
- package/dist/zonos-elements/p-04c38987.system.js +0 -1
- package/dist/zonos-elements/p-1b5a2714.system.entry.js +0 -1
- package/dist/zonos-elements/p-427c2766.entry.js +0 -1
- package/dist/zonos-elements/p-5edc11be.system.entry.js +0 -1
- package/dist/zonos-elements/p-81a54668.js +0 -1
- package/dist/zonos-elements/p-839448c3.js +0 -1
- package/dist/zonos-elements/p-8b33c3b7.entry.js +0 -1
- package/dist/zonos-elements/p-aed0098c.system.js +0 -1
- package/dist/zonos-elements/p-ef9fdf45.entry.js +0 -1
- package/dist/zonos-elements/p-f6c0da8b.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
4
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
5
5
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
6
6
|
const getBorderRadius = require('./getBorderRadius-94ef609c.js');
|
|
7
7
|
|
|
@@ -126,6 +126,11 @@ const jsonParse = (_data) => {
|
|
|
126
126
|
return null;
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
+
const checkoutBreakpoint = 890;
|
|
130
|
+
const isCheckoutMobile = (isMobile) => {
|
|
131
|
+
return isMobile || window.innerWidth < checkoutBreakpoint;
|
|
132
|
+
};
|
|
133
|
+
|
|
129
134
|
const getNavigatorConnection = () => {
|
|
130
135
|
const connection = 'connection' in window.navigator
|
|
131
136
|
? // connection is not yet supported in all browsers
|
|
@@ -156,7 +161,7 @@ const getAdditionalLogMetadata = () => {
|
|
|
156
161
|
connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
|
|
157
162
|
isHostedCheckout: window.Zonos.isLegacyCheckout,
|
|
158
163
|
screenHeight: window.screen.height,
|
|
159
|
-
screenWidth: window.
|
|
164
|
+
screenWidth: window.innerWidth,
|
|
160
165
|
userAgent: userAgentData && userAgentData.brands.length > 0
|
|
161
166
|
? userAgentData
|
|
162
167
|
: window.navigator.userAgent,
|
|
@@ -165,7 +170,7 @@ const getAdditionalLogMetadata = () => {
|
|
|
165
170
|
|
|
166
171
|
const blackListPaths = [
|
|
167
172
|
'/api/zonos-elements/log-script-load',
|
|
168
|
-
'/api/zonos-elements/log-bulk-load',
|
|
173
|
+
'/api/zonos-elements/log-bulk-load-data',
|
|
169
174
|
];
|
|
170
175
|
/**
|
|
171
176
|
* Prepares the load time api log for the given API call to send to the server later
|
|
@@ -176,20 +181,37 @@ const prepLoadTimeApiLog = ({ apiPath, apiType, loadTimeInternal, loadTimeTotal,
|
|
|
176
181
|
if (blackListPaths.includes(apiPath)) {
|
|
177
182
|
return;
|
|
178
183
|
}
|
|
184
|
+
const loadTimeBrowserApi = loadTimeTotal - loadTimeInternal;
|
|
185
|
+
// No need to record if the browser API load time is negative (cached)
|
|
186
|
+
if (loadTimeBrowserApi < 0) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// e.g. /api/zonos-elements/log-script-load?zonosDebug=1 -> /api/zonos-elements/log-script-load
|
|
179
190
|
const apiPathWithoutParams = apiPath.split('?')[0] || apiPath;
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
191
|
+
const additionalLogMetadata = getAdditionalLogMetadata();
|
|
192
|
+
const isMobileAgent = typeof additionalLogMetadata.userAgent === 'object' &&
|
|
193
|
+
additionalLogMetadata.userAgent.mobile;
|
|
194
|
+
const bulkLoadLogBody = {
|
|
195
|
+
apiType,
|
|
196
|
+
connectionType: additionalLogMetadata.connectionEffectiveType,
|
|
185
197
|
href: apiPathWithoutParams,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
198
|
+
isHostedCheckout: window.Zonos.isLegacyCheckout,
|
|
199
|
+
// Use the isMobileAgent to determine if the checkout is mobile, if it's not availabe, use the logic from isCheckoutMobile
|
|
200
|
+
isMobile: isCheckoutMobile(isMobileAgent),
|
|
201
|
+
loadTimeBrowserApi,
|
|
202
|
+
loadTimeInternal,
|
|
203
|
+
loadTimeTotal,
|
|
204
|
+
metadata: Object.assign({}, additionalLogMetadata),
|
|
205
|
+
screenHeight: additionalLogMetadata.screenHeight,
|
|
206
|
+
screenWidth: additionalLogMetadata.screenWidth,
|
|
207
|
+
userAgent: typeof additionalLogMetadata.userAgent === 'string'
|
|
208
|
+
? additionalLogMetadata.userAgent
|
|
209
|
+
: additionalLogMetadata.userAgent['brands']
|
|
210
|
+
.map(brand => brand.brand)
|
|
211
|
+
.filter(brand => !/Not.*A.*Brand.*/.test(brand))
|
|
212
|
+
.join(','),
|
|
191
213
|
};
|
|
192
|
-
window.Zonos.loadTimeApiInfoList.push(
|
|
214
|
+
window.Zonos.loadTimeApiInfoList.push(bulkLoadLogBody);
|
|
193
215
|
};
|
|
194
216
|
|
|
195
217
|
/**
|
|
@@ -475,6 +497,7 @@ exports.getElapsedTime = getElapsedTime;
|
|
|
475
497
|
exports.getIsStagingMode = getIsStagingMode;
|
|
476
498
|
exports.getIsTestMode = getIsTestMode;
|
|
477
499
|
exports.handleFetch = handleFetch;
|
|
500
|
+
exports.isCheckoutMobile = isCheckoutMobile;
|
|
478
501
|
exports.jsonParse = jsonParse;
|
|
479
502
|
exports.log = log;
|
|
480
503
|
exports.logError = logError;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
6
|
-
const CheckoutConfig = require('./CheckoutConfig-
|
|
5
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
6
|
+
const CheckoutConfig = require('./CheckoutConfig-fb59baa3.js');
|
|
7
7
|
const TaxId = require('./TaxId-4632639d.js');
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -129,7 +129,7 @@ const getZonosQaUrl = () => {
|
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
132
|
-
const cdnUrl = "https://v1.3.
|
|
132
|
+
const cdnUrl = "https://v1.3.174.js.zonos.com";
|
|
133
133
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
134
134
|
if (!qaUrl &&
|
|
135
135
|
(cdnUrl.includes('test.') ||
|
|
@@ -313,10 +313,10 @@ const zonosLoadUrl = (() => {
|
|
|
313
313
|
}
|
|
314
314
|
return null;
|
|
315
315
|
})();
|
|
316
|
-
const ZONOS_URL = "https://v1.3.
|
|
317
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
318
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
319
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
316
|
+
const ZONOS_URL = "https://v1.3.174.js.zonos.com";
|
|
317
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.174";
|
|
318
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.174";
|
|
319
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.174";
|
|
320
320
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
321
321
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
322
322
|
class Zonos {
|
|
@@ -330,7 +330,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
330
330
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
331
331
|
Zonos._paypalMockResponse = null;
|
|
332
332
|
Zonos.isBigCommerce = false;
|
|
333
|
-
Zonos.releaseDate = "
|
|
333
|
+
Zonos.releaseDate = "1742827810410";
|
|
334
334
|
Zonos.isLegacyCheckout = false;
|
|
335
335
|
Zonos.domain = typeof window !== 'undefined'
|
|
336
336
|
? // domain that embeds the iframe
|
|
@@ -346,7 +346,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
|
346
346
|
Zonos.isNpm = true;
|
|
347
347
|
Zonos.zonosQaUrl = null;
|
|
348
348
|
Zonos.zonosQaUrlApi = null;
|
|
349
|
-
Zonos.version = `v${"1.3.
|
|
349
|
+
Zonos.version = `v${"1.3.174"}`;
|
|
350
350
|
Zonos.modeAlerted = false;
|
|
351
351
|
Zonos.cartData = null;
|
|
352
352
|
Zonos.paypal = null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const cart = require('./cart-93ed3002.js');
|
|
5
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
7
7
|
|
|
8
8
|
/*!
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
|
-
const
|
|
9
|
-
const handleFetch = require('./handleFetch-ff25db40.js');
|
|
8
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
10
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
11
10
|
const classes = require('./classes-b7918f56.js');
|
|
12
11
|
const RemoveIcon$1 = require('./RemoveIcon-081ac073.js');
|
|
@@ -130,7 +129,7 @@ const ZonosAddress = class {
|
|
|
130
129
|
this.isAutoCompleteAdjusted = true;
|
|
131
130
|
}
|
|
132
131
|
// scroll directly into view if it's mobile
|
|
133
|
-
if (
|
|
132
|
+
if (handleFetch.isCheckoutMobile()) {
|
|
134
133
|
this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
135
134
|
}
|
|
136
135
|
else {
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-8b49ef07.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
10
|
-
const handleFetch = require('./handleFetch-
|
|
10
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
11
11
|
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
12
12
|
const getBorderRadius = require('./getBorderRadius-94ef609c.js');
|
|
13
|
-
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
14
13
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
15
14
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
16
15
|
const isColorVariable = require('./isColorVariable-525dbfa7.js');
|
|
@@ -1697,10 +1696,10 @@ const ZonosCheckoutFooter = class {
|
|
|
1697
1696
|
this.showLanguageDialog = !this.showLanguageDialog;
|
|
1698
1697
|
}
|
|
1699
1698
|
handleMobileChange() {
|
|
1700
|
-
this.isMobile =
|
|
1699
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
1701
1700
|
}
|
|
1702
1701
|
componentWillLoad() {
|
|
1703
|
-
this.isMobile =
|
|
1702
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
1704
1703
|
}
|
|
1705
1704
|
render() {
|
|
1706
1705
|
var _a;
|
|
@@ -2492,10 +2491,10 @@ const ZonosReview = class {
|
|
|
2492
2491
|
this.isMobile = false;
|
|
2493
2492
|
}
|
|
2494
2493
|
handleWindowResize() {
|
|
2495
|
-
this.isMobile =
|
|
2494
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
2496
2495
|
}
|
|
2497
2496
|
componentWillLoad() {
|
|
2498
|
-
this.isMobile =
|
|
2497
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
2499
2498
|
}
|
|
2500
2499
|
render() {
|
|
2501
2500
|
const total = cart.cartStoreHasOneEligibleItem() ? cart.cartStore.total : 0;
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
|
+
const paypal = require('./paypal-8b49ef07.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
10
|
-
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
9
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
11
10
|
const classes = require('./classes-b7918f56.js');
|
|
12
11
|
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
13
12
|
const getBorderRadius = require('./getBorderRadius-94ef609c.js');
|
|
14
13
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
15
14
|
const styles = require('./styles-d1e64fb9.js');
|
|
16
|
-
const CheckoutConfig = require('./CheckoutConfig-
|
|
15
|
+
const CheckoutConfig = require('./CheckoutConfig-fb59baa3.js');
|
|
17
16
|
const RemoveIcon = require('./RemoveIcon-081ac073.js');
|
|
18
17
|
|
|
19
18
|
/**
|
|
@@ -194,17 +193,20 @@ const sendBulkLoadTimeApiLog = async () => {
|
|
|
194
193
|
loadTimeApiInfoList: window.Zonos.loadTimeApiInfoList,
|
|
195
194
|
});
|
|
196
195
|
// Clone the list so we can clear it after sending the log
|
|
197
|
-
const loadTimeApiInfoListArray =
|
|
196
|
+
const loadTimeApiInfoListArray = {
|
|
197
|
+
data: [...window.Zonos.loadTimeApiInfoList],
|
|
198
|
+
storeId: window.Zonos.storeId || 0,
|
|
199
|
+
};
|
|
198
200
|
// Clear the list after sending the log successfully
|
|
199
201
|
window.Zonos.loadTimeApiInfoList.length = 0;
|
|
200
202
|
// Clear the list after sending the log successfully
|
|
201
|
-
const { errors } = await handleFetch.handleFetch('/api/zonos-elements/log-bulk-load', {
|
|
203
|
+
const { errors } = await handleFetch.handleFetch('/api/zonos-elements/log-bulk-load-data', {
|
|
202
204
|
body: loadTimeApiInfoListArray,
|
|
203
205
|
method: 'POST',
|
|
204
206
|
});
|
|
205
207
|
if (errors.length) {
|
|
206
208
|
// If there are errors, add the logs back to the list so we can try again later
|
|
207
|
-
window.Zonos.loadTimeApiInfoList.push(...loadTimeApiInfoListArray);
|
|
209
|
+
window.Zonos.loadTimeApiInfoList.push(...loadTimeApiInfoListArray.data);
|
|
208
210
|
numberOfFailures++;
|
|
209
211
|
if (numberOfFailures > 5 && window.Zonos.logIntervalId) {
|
|
210
212
|
// If there are more than 3 failures, stop the interval
|
|
@@ -1157,13 +1159,13 @@ const ZonosCheckout = class {
|
|
|
1157
1159
|
}
|
|
1158
1160
|
}
|
|
1159
1161
|
handleWindowResize() {
|
|
1160
|
-
this.isMobile =
|
|
1162
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
1161
1163
|
// apply theme to stripe elements
|
|
1162
1164
|
void this.applyStripeTheme();
|
|
1163
1165
|
handleFetch.log(`mobile: ${this.isMobile}`);
|
|
1164
1166
|
}
|
|
1165
1167
|
handleMobileChange() {
|
|
1166
|
-
this.isMobile =
|
|
1168
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
1167
1169
|
// apply theme to stripe elements
|
|
1168
1170
|
void this.applyStripeTheme();
|
|
1169
1171
|
handleFetch.log(`mobile: ${this.isMobile}`);
|
|
@@ -1258,7 +1260,7 @@ const ZonosCheckout = class {
|
|
|
1258
1260
|
}
|
|
1259
1261
|
componentWillLoad() {
|
|
1260
1262
|
void this.init();
|
|
1261
|
-
this.isMobile =
|
|
1263
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
1262
1264
|
this.isIframed = window.self !== window.top;
|
|
1263
1265
|
handleFetch.log(`iframed: ${this.isIframed}`);
|
|
1264
1266
|
// update theme to browser preference theme if appearance theme is system
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
|
-
const handleFetch = require('./handleFetch-
|
|
8
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
9
9
|
require('./isDarkColor-ec4a4e7d.js');
|
|
10
10
|
require('./getBorderRadius-94ef609c.js');
|
|
11
11
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
require('./handleFetch-
|
|
9
|
+
require('./handleFetch-969d05d8.js');
|
|
10
10
|
require('./isDarkColor-ec4a4e7d.js');
|
|
11
11
|
require('./getBorderRadius-94ef609c.js');
|
|
12
12
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
|
|
10
10
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
11
|
-
require('./handleFetch-
|
|
11
|
+
require('./handleFetch-969d05d8.js');
|
|
12
12
|
require('./getBorderRadius-94ef609c.js');
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -6,9 +6,9 @@ const index = require('./index-2f90486e.js');
|
|
|
6
6
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
const getBorderRadius = require('./getBorderRadius-94ef609c.js');
|
|
9
|
-
const cart = require('./cart-
|
|
10
|
-
const handleFetch = require('./handleFetch-
|
|
11
|
-
const paypal = require('./paypal-
|
|
9
|
+
const cart = require('./cart-93ed3002.js');
|
|
10
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
11
|
+
const paypal = require('./paypal-8b49ef07.js');
|
|
12
12
|
require('./isDarkColor-ec4a4e7d.js');
|
|
13
13
|
|
|
14
14
|
const PaymentEmptyStateDarkIcon = `<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
11
|
-
require('./handleFetch-
|
|
11
|
+
require('./handleFetch-969d05d8.js');
|
|
12
12
|
require('./isDarkColor-ec4a4e7d.js');
|
|
13
13
|
require('./getBorderRadius-94ef609c.js');
|
|
14
14
|
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-93ed3002.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
9
|
+
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
11
11
|
require('./isDarkColor-ec4a4e7d.js');
|
|
12
12
|
require('./getBorderRadius-94ef609c.js');
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-93ed3002.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-3812b318.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
|
-
require('./handleFetch-
|
|
9
|
+
require('./handleFetch-969d05d8.js');
|
|
10
10
|
require('./isDarkColor-ec4a4e7d.js');
|
|
11
11
|
require('./getBorderRadius-94ef609c.js');
|
|
12
12
|
|
|
@@ -12,7 +12,7 @@ export const getAdditionalLogMetadata = () => {
|
|
|
12
12
|
connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
|
|
13
13
|
isHostedCheckout: window.Zonos.isLegacyCheckout,
|
|
14
14
|
screenHeight: window.screen.height,
|
|
15
|
-
screenWidth: window.
|
|
15
|
+
screenWidth: window.innerWidth,
|
|
16
16
|
userAgent: userAgentData && userAgentData.brands.length > 0
|
|
17
17
|
? userAgentData
|
|
18
18
|
: window.navigator.userAgent,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { isCheckoutMobile } from "../checkout/isCheckoutMobile";
|
|
1
2
|
import { getAdditionalLogMetadata } from "./getAdditionalLogMetadata";
|
|
2
3
|
const blackListPaths = [
|
|
3
4
|
'/api/zonos-elements/log-script-load',
|
|
4
|
-
'/api/zonos-elements/log-bulk-load',
|
|
5
|
+
'/api/zonos-elements/log-bulk-load-data',
|
|
5
6
|
];
|
|
6
7
|
/**
|
|
7
8
|
* Prepares the load time api log for the given API call to send to the server later
|
|
@@ -12,18 +13,35 @@ export const prepLoadTimeApiLog = ({ apiPath, apiType, loadTimeInternal, loadTim
|
|
|
12
13
|
if (blackListPaths.includes(apiPath)) {
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
16
|
+
const loadTimeBrowserApi = loadTimeTotal - loadTimeInternal;
|
|
17
|
+
// No need to record if the browser API load time is negative (cached)
|
|
18
|
+
if (loadTimeBrowserApi < 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// e.g. /api/zonos-elements/log-script-load?zonosDebug=1 -> /api/zonos-elements/log-script-load
|
|
15
22
|
const apiPathWithoutParams = apiPath.split('?')[0] || apiPath;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
const additionalLogMetadata = getAdditionalLogMetadata();
|
|
24
|
+
const isMobileAgent = typeof additionalLogMetadata.userAgent === 'object' &&
|
|
25
|
+
additionalLogMetadata.userAgent.mobile;
|
|
26
|
+
const bulkLoadLogBody = {
|
|
27
|
+
apiType,
|
|
28
|
+
connectionType: additionalLogMetadata.connectionEffectiveType,
|
|
21
29
|
href: apiPathWithoutParams,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
isHostedCheckout: window.Zonos.isLegacyCheckout,
|
|
31
|
+
// Use the isMobileAgent to determine if the checkout is mobile, if it's not availabe, use the logic from isCheckoutMobile
|
|
32
|
+
isMobile: isCheckoutMobile(isMobileAgent),
|
|
33
|
+
loadTimeBrowserApi,
|
|
34
|
+
loadTimeInternal,
|
|
35
|
+
loadTimeTotal,
|
|
36
|
+
metadata: Object.assign({}, additionalLogMetadata),
|
|
37
|
+
screenHeight: additionalLogMetadata.screenHeight,
|
|
38
|
+
screenWidth: additionalLogMetadata.screenWidth,
|
|
39
|
+
userAgent: typeof additionalLogMetadata.userAgent === 'string'
|
|
40
|
+
? additionalLogMetadata.userAgent
|
|
41
|
+
: additionalLogMetadata.userAgent['brands']
|
|
42
|
+
.map(brand => brand.brand)
|
|
43
|
+
.filter(brand => !/Not.*A.*Brand.*/.test(brand))
|
|
44
|
+
.join(','),
|
|
27
45
|
};
|
|
28
|
-
window.Zonos.loadTimeApiInfoList.push(
|
|
46
|
+
window.Zonos.loadTimeApiInfoList.push(bulkLoadLogBody);
|
|
29
47
|
};
|
|
@@ -10,17 +10,20 @@ export const sendBulkLoadTimeApiLog = async () => {
|
|
|
10
10
|
loadTimeApiInfoList: window.Zonos.loadTimeApiInfoList,
|
|
11
11
|
});
|
|
12
12
|
// Clone the list so we can clear it after sending the log
|
|
13
|
-
const loadTimeApiInfoListArray =
|
|
13
|
+
const loadTimeApiInfoListArray = {
|
|
14
|
+
data: [...window.Zonos.loadTimeApiInfoList],
|
|
15
|
+
storeId: window.Zonos.storeId || 0,
|
|
16
|
+
};
|
|
14
17
|
// Clear the list after sending the log successfully
|
|
15
18
|
window.Zonos.loadTimeApiInfoList.length = 0;
|
|
16
19
|
// Clear the list after sending the log successfully
|
|
17
|
-
const { errors } = await handleFetch('/api/zonos-elements/log-bulk-load', {
|
|
20
|
+
const { errors } = await handleFetch('/api/zonos-elements/log-bulk-load-data', {
|
|
18
21
|
body: loadTimeApiInfoListArray,
|
|
19
22
|
method: 'POST',
|
|
20
23
|
});
|
|
21
24
|
if (errors.length) {
|
|
22
25
|
// If there are errors, add the logs back to the list so we can try again later
|
|
23
|
-
window.Zonos.loadTimeApiInfoList.push(...loadTimeApiInfoListArray);
|
|
26
|
+
window.Zonos.loadTimeApiInfoList.push(...loadTimeApiInfoListArray.data);
|
|
24
27
|
numberOfFailures++;
|
|
25
28
|
if (numberOfFailures > 5 && window.Zonos.logIntervalId) {
|
|
26
29
|
// If there are more than 3 failures, stop the interval
|
|
@@ -462,9 +462,6 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
462
462
|
allSettings(variables, requestHeaders) {
|
|
463
463
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'allSettings', 'query');
|
|
464
464
|
},
|
|
465
|
-
analyticConversionEvent(variables, requestHeaders) {
|
|
466
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'analyticConversionEvent', 'query');
|
|
467
|
-
},
|
|
468
465
|
cleanupTestErrors(variables, requestHeaders) {
|
|
469
466
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cleanupTestErrors', 'mutation');
|
|
470
467
|
},
|
|
@@ -474,6 +471,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
474
471
|
createBulkLoadEvent(variables, requestHeaders) {
|
|
475
472
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createBulkLoadEvent', 'mutation');
|
|
476
473
|
},
|
|
474
|
+
createBulkScriptLoadEvent(variables, requestHeaders) {
|
|
475
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createBulkScriptLoadEvent', 'mutation');
|
|
476
|
+
},
|
|
477
477
|
createErrorEvent(variables, requestHeaders) {
|
|
478
478
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createErrorEvent', 'mutation');
|
|
479
479
|
},
|
|
@@ -534,12 +534,6 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
534
534
|
localeCountryMessages(variables, requestHeaders) {
|
|
535
535
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'localeCountryMessages', 'query');
|
|
536
536
|
},
|
|
537
|
-
metricAllApiPaths(variables, requestHeaders) {
|
|
538
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'metricAllApiPaths', 'query');
|
|
539
|
-
},
|
|
540
|
-
metricApiPathSpeed(variables, requestHeaders) {
|
|
541
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'metricApiPathSpeed', 'query');
|
|
542
|
-
},
|
|
543
537
|
storeVersionSetting(variables, requestHeaders) {
|
|
544
538
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'storeVersionSetting', 'query');
|
|
545
539
|
},
|
|
@@ -278,6 +278,7 @@ export const carrierRateType = {
|
|
|
278
278
|
export const cartAdjustmentType = {
|
|
279
279
|
CartTotal: 'CART_TOTAL',
|
|
280
280
|
Item: 'ITEM',
|
|
281
|
+
OrderTotal: 'ORDER_TOTAL',
|
|
281
282
|
PromoCode: 'PROMO_CODE',
|
|
282
283
|
Shipping: 'SHIPPING',
|
|
283
284
|
};
|
|
@@ -2744,12 +2745,6 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2744
2745
|
organization(variables, requestHeaders) {
|
|
2745
2746
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'organization', 'query');
|
|
2746
2747
|
},
|
|
2747
|
-
organizationByStoreId(variables, requestHeaders) {
|
|
2748
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'organizationByStoreId', 'query');
|
|
2749
|
-
},
|
|
2750
|
-
organizations(variables, requestHeaders) {
|
|
2751
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'organizations', 'query');
|
|
2752
|
-
},
|
|
2753
2748
|
partyInfo(variables, requestHeaders) {
|
|
2754
2749
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'partyInfo', 'query');
|
|
2755
2750
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getIsTestMode, h as handleFetch, l as log, b as logError } from './handleFetch-
|
|
1
|
+
import { g as getIsTestMode, h as handleFetch, l as log, b as logError } from './handleFetch-621e45bc.js';
|
|
2
2
|
|
|
3
3
|
const getTempCartById = async ({ cartId, retries, }) => {
|
|
4
4
|
const isTestMode = getIsTestMode();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-d3c5a0a5.js';
|
|
2
|
-
import { h as handleFetch, b as logError, l as log, f as fallbackApiList, s as sendErrorLog, d as allLogs, j as jsonParse, a as getIsStagingMode } from './handleFetch-
|
|
2
|
+
import { h as handleFetch, b as logError, l as log, f as fallbackApiList, s as sendErrorLog, d as allLogs, j as jsonParse, a as getIsStagingMode } from './handleFetch-621e45bc.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor-446fccb7.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
|
|
5
5
|
|